import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { firstValueFrom } from 'rxjs/internal/firstValueFrom';
import { appConfig } from 'src/app/config/app-config';
import { ColumnData, InformationService } from 'src/app/service/information.service';

export const guideItems = [
  // {
  //   title: '用水指南',
  //   icon: 'assets/images/home/water/用水常识.svg',
  //   router: '',
  //   type: 'zc003_REGU_WATER'
  // },
  // {
  //   title: '政策法规',
  //   icon: 'assets/images/home/water/政策法规.svg',
  //   router: '',
  //   type: 'z003_LAWS_ZCFG'
  // },
  // {
  //   title: '业务办理指南',
  //   icon: 'assets/images/home/water/用户须知.svg',
  //   router: '',
  //   type: 'z003_BUSI_GUIDE01'
  // },
  // {
  //   title: '资费标准',
  //   icon: 'assets/images/home/water/资费标准.svg',
  //   router: '',
  //   type: 'SJXX'
  // },
  {
    title: '水质公告',
    icon: 'assets/images/home/water/水质公告.svg',
    router: '',
    type: 'water_quality_notice'
  },
  // {
  //   title: '客服热线',
  //   icon: 'assets/images/home/water/服务规范.svg',
  //   router: '',
  //   type: 'KFRX'
  // },
]

@Component({
  selector: 'app-information',
  templateUrl: './information.component.html',
  styleUrls: ['./information.component.scss']
})
export class InformationComponent implements OnInit {

  constructor(
    private router: Router,
    private route: ActivatedRoute,
    public information: InformationService
  ) { }

  ngOnInit(): void {
    this.route.queryParams.subscribe({
      next: (res: any) => {
        if(res && res.code){
          this.informationType = res.code
        }
      }
    })
  }

  informationType = appConfig.COLUMN_CODE
  switchInformation(item: ColumnData){
    console.log(item)
    this.informationType = item.code
    this.router.navigate(['/information/column-list'], { queryParams: { code: item.code } })
  }

}
